function t = theta(g,ksi)
if(g==0)
    t=acos(2*ksi-1);
else
    t=acos((1/(2*g))*(1+g^2-((1-g^2)/(1-g+2*g*ksi))^2));
end